home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 April / PCWorld_2008-04_cd.bin / v cisle / updatestar / UpdateStar_Web_ENU.msi / NewsXsl < prev    next >
Extensible Markup Language  |  2007-12-10  |  9KB  |  328 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:template match="servernews/stylepath"></xsl:template>
  5. <xsl:template match="servernews/language"></xsl:template>
  6. <xsl:template match="servernews/largefont"></xsl:template>
  7.  
  8.  
  9.  
  10. <xsl:variable name="language"><xsl:value-of select="servernews/language"/></xsl:variable>
  11. <xsl:variable name="stylepathorig"><xsl:value-of select="servernews/stylepath"/></xsl:variable>
  12. <xsl:variable name="largefont"><xsl:value-of select="servernews/largefont"/></xsl:variable>
  13. <xsl:variable name="stylepath"><xsl:copy-of select="$stylepathorig"/>\img\</xsl:variable>
  14.  
  15.  
  16. <xsl:template match="servernews/newslist">
  17.  
  18. <html><head>
  19. <xsl:element name="link">
  20.     <xsl:attribute name="href"><xsl:copy-of select="$stylepathorig"/>/style.css</xsl:attribute>
  21.     <xsl:attribute name="rel">stylesheet</xsl:attribute>
  22.     <xsl:attribute name="type">text/css</xsl:attribute>
  23. </xsl:element>
  24.  
  25. <xsl:if test="$largefont='yes'">
  26.     <style type="text/css">
  27.         td     {
  28.             font-size: 15px;
  29.         }
  30.         
  31.         td.desc{
  32.             font-size:13px;
  33.         }
  34.         td.normal{
  35.             font-size:13px;
  36.         }
  37.         td.normalbig{
  38.             font-size:13px;
  39.         }
  40.         a.sublink{
  41.             font-size:11px;
  42.             font-weight:bold;
  43.         }
  44.     </style>
  45. </xsl:if>
  46.  
  47.  
  48. <!--
  49. <xsl:element name="SCRIPT">
  50.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  51.     <xsl:attribute name="SRC"><xsl:copy-of select="$stylepathorig"/>\<xsl:copy-of select="$language"/>.js</xsl:attribute>
  52. </xsl:element>
  53.  
  54.  
  55. <xsl:element name="SCRIPT">
  56.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  57.     <xsl:attribute name="SRC"><xsl:copy-of select="$stylepathorig"/>\slang.js</xsl:attribute>
  58. </xsl:element>
  59. -->
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. <xsl:element name="SCRIPT">
  70.     <xsl:attribute name="language">JavaScript</xsl:attribute>
  71. function translate(){
  72.     for (newalt in sfields) {
  73.         if(document.getElementById(newalt) ){
  74.             if(document.getElementById(newalt).alt){//image
  75.                 document.getElementById(newalt).alt=sfields[newalt];
  76.             }else if(document.getElementById(newalt).value == ""){//input
  77.                 document.getElementById(newalt).value=sfields[newalt];
  78.             }else{
  79.                 document.getElementById(newalt).innerHTML=sfields[newalt];//default div element
  80.             }
  81.         }
  82.  
  83.             if(document.getElementById(newalt + "_" + 0)){
  84.                 document.getElementById(newalt + "_" + 0).innerHTML=sfields[newalt];
  85.             }
  86.             
  87.             if(document.getElementById(newalt + "_" + 1)){
  88.                 document.getElementById(newalt + "_" + 1).innerHTML=sfields[newalt];
  89.             }
  90.             
  91.             if(document.getElementById(newalt + "_" + 2)){
  92.                 document.getElementById(newalt + "_" + 2).innerHTML=sfields[newalt];
  93.             }
  94.             
  95.             if(document.getElementById(newalt + "_" + 3)){
  96.                 document.getElementById(newalt + "_" + 3).innerHTML=sfields[newalt];
  97.             }
  98.             
  99.             if(document.getElementById(newalt + "_" + 4)){
  100.                 document.getElementById(newalt + "_" + 4).innerHTML=sfields[newalt];
  101.             }
  102.             
  103.             if(document.getElementById(newalt + "_" + 5)){
  104.                 document.getElementById(newalt + "_" + 5).innerHTML=sfields[newalt];
  105.             }
  106.                 
  107.         }
  108. }
  109.  
  110.  
  111. var sfields = new Array();
  112.  
  113. //start
  114. sfields["str_noupdate"]        = "No Updates Available";
  115. sfields["str_yesupdate"]    = "Updates Available!";
  116. sfields["str_lastscan"]        = "Last Update Scan:";
  117. sfields["str_foundprogs"]    = "Programs found:";
  118. sfields["str_foundupdates"]    = "Updates found:";
  119. sfields["searchbutton"]        = "Search for Updates";
  120. sfields["listbutton"]        = "Program List";
  121. sfields["str_availupdates"]    = "Updates Available:";
  122. sfields["str_availvers"]    = "Version:";
  123. sfields["str_availnews"]    = "News:";
  124.  
  125.  
  126. //details
  127. sfields["str_pname"]        = "Product name:";
  128. sfields["str_publisher"]    = "Publisher:";
  129. sfields["str_category"]     = "Category:";
  130. sfields["str_license"]         = "License:";
  131. sfields["str_irequirements"] = "System Requirements";
  132. sfields["str_iversion"]     = "Installed Version:";
  133. sfields["str_uversion"]     = "Current Version:";
  134. sfields["str_management"]     = "Administration:";
  135. sfields["str_info"]         = "Info:";
  136. sfields["str_sdesc"]         = "Short description:";
  137. sfields["str_desc"]         = "Description:";
  138. sfields["str_download"]     = "Download";
  139. sfields["str_buynow"]         = "Buy now";
  140. sfields["str_buyfrom"]         = "from ";
  141. sfields["str_errlink"]         = "incorrect link";
  142. sfields["str_sendupdate"]     = "Send Update";
  143. sfields["sendupdate"]         = "Send Update";
  144. sfields["alt_uninstall"]    = "Uninstall ";
  145. sfields["alt_repair"]         = "Repair";
  146. sfields["alt_modify"]         = "Modify";
  147.  
  148. sfields["str_newstitle"]    = "Title";
  149. sfields["str_newsdata"]     = "Date";
  150.  
  151. </xsl:element>
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. <xsl:if test="$language='1031'">
  159.     <script type="text/javascript">
  160.     
  161. //start
  162. sfields["str_noupdate"]        = "Keine Updates verfⁿgbar";
  163. sfields["str_yesupdate"]    = "Updates verfⁿgbar!";
  164. sfields["str_lastscan"]        = "Letzter Update-Scan:";
  165. sfields["str_foundprogs"]    = "Gefundene Programme:";
  166. sfields["str_foundupdates"]    = "Gefundene Updates:";
  167. sfields["searchbutton"]        = "Updates suchen";
  168. sfields["listbutton"]        = "Programmliste";
  169. sfields["str_availupdates"]    = "Verfⁿgbare Updates:";
  170. sfields["str_availvers"]    = "Aktuelle Version:";
  171. sfields["str_availnews"]    = "Verfⁿgbare Meldungen:";
  172.  
  173.  
  174. //details
  175. sfields["str_pname"]        = "Produktname:";
  176. sfields["str_publisher"]    = "Hersteller:";
  177. sfields["str_category"]     = "Produktkategorie:";
  178. sfields["str_irequirements"] = "Systemanforderungen:";
  179. sfields["str_license"]         = "Lizenz:";
  180. sfields["str_iversion"]     = "Installierte Version:";
  181. sfields["str_uversion"]     = "Aktuelle Version:";
  182. sfields["str_management"]     = "Verwaltung:";
  183. sfields["str_info"]         = "Info:";
  184. sfields["str_sdesc"]         = "Kurze Beschreibung:";
  185. sfields["str_desc"]         = "Beschreibung:";
  186. sfields["str_download"]     = "Download";
  187. sfields["str_buynow"]         = "Jetzt kaufen";
  188. sfields["str_buyfrom"]         = "von ";
  189. sfields["str_errlink"]         = "Link ist falsch";
  190. sfields["str_sendupdate"]     = "Update senden";
  191. sfields["sendupdate"]         = "Update senden";
  192. sfields["alt_uninstall"]    = "Deinstallieren ";
  193. sfields["alt_repair"]         = "Reparieren";
  194. sfields["alt_modify"]         = "─ndern";
  195.  
  196. //news
  197. sfields["str_newstitle"]    = "Titel";
  198. sfields["str_newsdata"]     = "Datum";
  199.  
  200.     </script>
  201. </xsl:if>
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211. </head>
  212.  
  213. <body onload="if(window.translate)translate(); ">
  214.  
  215.  
  216.  
  217.  
  218. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  219.                         <tr>
  220.                             <td class="tl">
  221.                                 <xsl:element name="img">
  222.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/tbl/shim.gif</xsl:attribute>
  223.                                     <xsl:attribute name="width">2</xsl:attribute>
  224.                                     <xsl:attribute name="height">2</xsl:attribute>
  225.                                 </xsl:element>
  226.                             </td><td class="tm" width="100%"></td>
  227.                             <td class="tr">
  228.                                 <xsl:element name="img">
  229.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/tbl/shim.gif</xsl:attribute>
  230.                                     <xsl:attribute name="width">2</xsl:attribute>
  231.                                     <xsl:attribute name="height">2</xsl:attribute>
  232.                                 </xsl:element>
  233.                             </td>
  234.                         </tr>
  235.                         <tr>
  236.                             <td class="ml"></td>
  237.                             <td width="100%" class="wbox">
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  246.     <tr><td valign="top" >
  247.         <table border="0" cellpadding="5" cellspacing="0" width="100%">
  248.             <TR><TD style="white-space: nowrap;padding-left:30px;"><b><div id="str_newsdata">.</div></b></TD>
  249.             <TD width="70%" style="white-space: nowrap;"><b><div id="str_newstitle">.</div></b></TD></TR>
  250.             <xsl:apply-templates />
  251.         </table>
  252.     </td></tr>
  253. </table>
  254.  
  255.  
  256.                             </td>
  257.                             <td class="mr"></td>
  258.                         </tr>
  259.                         <tr>
  260.                             <td class="ml"></td>
  261.                             <td valign="top" class="wbox">
  262.                                 <xsl:element name="img">
  263.                                     <xsl:attribute name="border">0</xsl:attribute>
  264.                                     <xsl:attribute name="align">right</xsl:attribute>
  265.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>star.gif</xsl:attribute>
  266.                                 </xsl:element>
  267.                             </td>
  268.                             <td class="mr"></td>
  269.                         </tr>    
  270.                         <tr>
  271.                             <td class="bl">
  272.                                 <xsl:element name="img">
  273.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/img/tbl/shim.gif</xsl:attribute>
  274.                                     <xsl:attribute name="width">2</xsl:attribute>
  275.                                     <xsl:attribute name="height">2</xsl:attribute>
  276.                                 </xsl:element>
  277.                             </td>
  278.                             <td class="bm"></td>
  279.                             <td class="br">
  280.                                 <xsl:element name="img">
  281.                                     <xsl:attribute name="src"><xsl:copy-of select="$stylepath"/>/img/tbl/shim.gif</xsl:attribute>
  282.                                     <xsl:attribute name="width">2</xsl:attribute>
  283.                                     <xsl:attribute name="height">2</xsl:attribute>
  284.                                 </xsl:element>
  285.                             </td>
  286.                         </tr>
  287.                 
  288.                     </table>
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.   
  298. </body></html>
  299. </xsl:template>
  300.  
  301. <xsl:template match="news">
  302.  <TR>
  303.     <TD class="normalbig">
  304.         <xsl:element name="div">
  305.             <xsl:attribute name="class"><xsl:value-of select="type" /></xsl:attribute>
  306.             <xsl:value-of select="date" />
  307.         </xsl:element>
  308.     
  309.     
  310.         
  311.     </TD>
  312.     <TD style="white-space: nowrap;" class="normalbig">
  313.         <xsl:element name="a">
  314.             <xsl:attribute name="href">javascript:window.external.OpenNews(<xsl:value-of select="id" />);</xsl:attribute>
  315.             <xsl:attribute name="alt"><xsl:value-of select="url" /></xsl:attribute>
  316.             <xsl:value-of select="title" />
  317.         </xsl:element>
  318.     </TD>
  319.  
  320.  </TR>
  321. </xsl:template>
  322.  
  323.  
  324.  
  325.  
  326.  
  327. </xsl:stylesheet>
  328.